import 'dart:convert';

import 'package:flutter_09_game/user/app_user_manager.dart';

class SharedKey {
  static String get deviceId => 'device_id';

  static String get token => 'app_user_token';

  static String get userInfo => 'app_user_Info';
  static String get appLanguage => 'app_language';

  /// 保存的账户名
  static String get savedAccount => "saved_account";

  /// 保存的密码
  static String get savedPassword => "saved_password";

  /// 记住密码状态
  static String get rememberPassword => "remember_password";

  /// 登录的 ip
  static String get lastLoginIp => "last_login_ip";

  /// 公告24小时内不显示的截止时间戳
  // static String get noticeNoShowUntil => "notice_no_show_until".addUid;

  /// 游戏音效开关状态
  static String get gameSoundEnabled => "game_sound_enabled".addUid;


  static String get aipConfig => "aip_config";
}

extension StringMd5Extension on String {
  String get addUid =>
      this + (AppUserManager().user.value?.id?.toString() ?? "");

  String get toBase64Encode => base64Encode(utf8.encode(this));

  String get toBase64Decode => const Utf8Decoder().convert(base64Decode(this));
}
